package com.pmsystem.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pmsystem.dao.GasConsumeMapper;
import com.pmsystem.pojo.GasConsume;
import com.pmsystem.util.BeanUtil;

@Service
public class GasConsumeService {

	@Autowired
	private GasConsumeMapper gasConsumeMapper;

	/**
	 * 
	 * <p>Title: addGasConsume</p >  
	 * <p>Description: 录入燃气信息</p >  
	 * @author 泽强
	 * @param gasConsume
	 * @return
	 */
	public boolean addGasConsume(GasConsume gasConsume) {
		int flag = gasConsumeMapper.insertSelective(gasConsume);
		return flag==1?true:false;
	}
	
	/**
	 * 
	 * <p>Title: updateGasConsume</p >  
	 * <p>Description: 修改燃气信息</p >  
	 * @author 泽强
	 * @param gasConsume
	 * @return
	 */
	public boolean updateGasConsume(GasConsume gasConsume) {
		int flag = gasConsumeMapper.updateByPrimaryKeySelective(gasConsume);
		return flag==1?true:false;
	}

	public List<GasConsume> findGasConsume(Map<String, Object> map) {
		return gasConsumeMapper.findGasConsume(BeanUtil.mapToMapWithoutNull(map));
	}
}
